package demo.DataStrucAndAlgo.SingletonPattern.Prototype;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/8/13-08-13-17:30
 * @Description：demo.DataStrucAndAlgo.SingletonPattern.Prototype
 */
public class PrototypePatternDemo {
    public static void main(String[] args) {
        ShapeCache.loadCache();

        Shape clonedShape1 = (Shape) ShapeCache.getShape("1");
        System.out.println("Shape: " + clonedShape1.getType());

        Shape clonedShape2 = (Shape) ShapeCache.getShape("2");
        System.out.println("Shape: " + clonedShape2.getType());

        Shape clonedShape3 = (Shape) ShapeCache.getShape("3");
        System.out.println("Shape: " + clonedShape3.getType());
    }
}
